﻿using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;

namespace DeviceSDK.LED.LingXin
{
    public static class LingXin_SDK
    {
        //设置播放盒参数
        [DllImport("lingxin_q3.dll", EntryPoint = "SetScreenWH", CharSet = CharSet.Unicode)]
        public static extern void SetScreenWH(int ID, int W, int H, string StrIP);


        //通过软件开关屏
        [DllImport("lingxin_q3.dll", EntryPoint = "ScreenON_OFF", CharSet = CharSet.Unicode)]
        public static extern bool ScreenON_OFF(string strIP, int op);

        //////////////////////////////////////////////////////////////////////////

        //添加rtf文件
        [DllImport("lingxin_q3.dll", EntryPoint = "AddTextArea", CharSet = CharSet.Unicode)]
        public static extern bool AddTextArea(int program_id, string programname, int playtime, bool waitfinish, int area_id, int x, int y, int w, int h, string areaname, int edge_degree, int edge_color, int bk_mode, int bk_color, int file_id, string textpath, int moveintype, int moveinspeed, int remain, int moveouttype, int moveoutspeed, int linespace, string StrIP);

        //添加 单行文本
        [DllImport("lingxin_q3.dll", EntryPoint = "AddOneLineTextArea", CharSet = CharSet.Unicode)]
        public static extern bool AddOneLineTextArea(int program_id, string programname, int playtime, bool waitfinish, int area_id, int x, int y, int w, int h, string areaname, int edge_degree, uint edge_color, int bk_mode, uint bk_color, int file_id, string textpath, int moveintype, int moveinspeed, int remain, int moveouttype, int moveoutspeed, int linespace, bool ISTOP, string strIP);

        //直接通过字符串添加 文本
        [DllImport("lingxin_q3.dll", EntryPoint = "AddStringTxtArea", CharSet = CharSet.Unicode)]
        public static extern bool AddStringTxtArea(int program_id, string programname, int playtime, bool waitfinish, int area_id, int x, int y, int w, int h, string areaname, int edge_degree, uint edge_color, int bk_mode, uint bk_color, int file_id, int moveintype, int moveinspeed, int remain, int moveouttype, int moveoutspeed, int linespace, uint FontColor, string fontName, int fontSize, bool IsBOLD, bool IsITALIC, bool IsUNDERLINE, int HorAlign, string TextData, string strIP);


        //添加图片
        [DllImport("lingxin_q3.dll", EntryPoint = "AddPictureArea", CharSet = CharSet.Unicode)]
        public static extern bool AddPictureArea(int program_id, string programname, int playtime, bool waitfinish, int area_id, int x, int y, int w, int h, string areaname, int file_id, string picpath, int moveintype, int moveinspeed, int remain, int moveouttype, int moveoutspeed, string StrIP);


        //添加动画
        [DllImport("lingxin_q3.dll", EntryPoint = "AddAnimationArea", CharSet = CharSet.Unicode)]
        public static extern bool AddAnimationArea(int program_id, string programname, int playtime, bool waitfinish, int area_id, int x, int y, int w, int h, string areaname, int file_id, string filepath, int playspeed, string StrIP);


        //添加视频
        [DllImport("lingxin_q3.dll", EntryPoint = "AddVideoArea", CharSet = CharSet.Unicode)]
        public static extern bool AddVideoArea(int program_id, string programname, int playtime, bool waitfinish, int area_id, int x, int y, int w, int h, string areaname, int file_id, string videopath, int videosource_x, int videosource_y, int videosource_w, int videosource_h, int videoorg_x, int videoorg_y, int showmode, string StrIP);

        //添加数字时钟
        [DllImport("lingxin_q3.dll", EntryPoint = "AddClockArea", CharSet = CharSet.Unicode)]
        public static extern void AddClockArea(int program_id, string programname, int playtime, bool waitfinish, int playtimes, int area_id, int x, int y, int w, int h, string areaname, int file_id, int yearstyle, int hourstyle, int showmode, int differ_x, int differ_m, int differ_s, int differ_type, int second, int minute, int hour, int week, int day, int month, int year, int ld, int lm, int ly, string RTF_ShowData, string RTF_fontname, int RTF_fontsize, int RTF_fontcolor, bool RTF_bold, bool RTF_italic, bool RTF_underline, int RTF_align, string StrIP);

        //发送函数
        [DllImport("lingxin_q3.dll", EntryPoint = "SendProgram", CharSet = CharSet.Unicode)]
        public static extern bool SendProgram(string strIP, int pNull1, int pNull2, int ProgramID);

        //点播预存节目
        [DllImport("lingxin_q3.dll", EntryPoint = "ChangeProgram", CharSet = CharSet.Unicode)]
        public static extern bool ChangeProgram(string strIP, int FileType);


        //删除节目节点
        [DllImport("lingxin_q3.dll", EntryPoint = "DeleteTheProgram", CharSet = CharSet.Unicode)]
        public static extern bool DeleteTheProgram(int program_id, string StrIP);

        //删除区域节点
        [DllImport("lingxin_q3.dll", EntryPoint = "DeleteTheArea", CharSet = CharSet.Unicode)]
        public static extern bool DeleteTheArea(int program_id, int area_id, string StrIP);

        //删除文件节点
        [DllImport("lingxin_q3.dll", EntryPoint = "DeleteTheFile", CharSet = CharSet.Unicode)]
        public static extern bool DeleteTheFile(int program_id, int area_id, int file_id, string StrIP);


        //手动校时
        [DllImport("lingxin_q3.dll", EntryPoint = "AdjustTime", CharSet = CharSet.Unicode)]
        public static extern bool AdjustTime(string StrIP);

        // 手动亮度
        [DllImport("lingxin_q3.dll", EntryPoint = "AdjustBright", CharSet = CharSet.Unicode)]
        public static extern bool AdjustBright(string StrIP, int Value);
    }
}
